﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Kokomo.Mirror.PeFormat
{
	public class ImportedModule
	{
		public ImportedModule(
			string moduleName,
			int timeDateStamp,
			bool isDelayLoaded = false
			)
		{
			if (moduleName == null) throw new ArgumentNullException("moduleName");
			this.ModuleName = moduleName;
			this.TimeDateStamp = timeDateStamp;
			this.IsDelayLoaded = isDelayLoaded;

			this.Functions = new List<ImportedFunction>();
		}

		public override string ToString()
		{
			return this.ModuleName;
		}

		public string ModuleName { get; private set; }

		[DisplayName("Time/date stamp")]
		[TypeConverter(typeof(HexConverter))]
		public int TimeDateStamp { get; private set; }

		[Browsable(false)]
		public IList<ImportedFunction> Functions { get; private set; }

		[DisplayName("Is delay-loaded")]
		public bool IsDelayLoaded { get; private set; }
	}
}
